<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery-3.3.1.js"></script>
</head>
<body>
<input  type="button" id="jsonBn" value="登录"/><br/>
<script>
    $(document).ready(function () {
        $("#jsonBn").click(function () {
            $.ajax({
                type: "post",
                url: "grade!load",
                dataType: "json",
                success: function (data) {
                    var grade = data["gradeData"];
                    var table=$("<table border='1'>");
                    for(var i=0;i<2;i++)
                    {
                        var $tr=$("<tr></tr>");
                        $tr.append("<td>"+data[i].name+"</td>");
                        $tr.append("<td>"+data[i].score+"</td>");
                    }
                    $tr.appendTo("</table>");
                    // console.log(grade);
                },
                error: function () {
                    alert("系统异常");
                }
            });
        });
    });
</script>
</body>
</html>